﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace XMM.Controls.Library
{
    /// <summary>
    /// Interaktionslogik für Holster_Files.xaml
    /// </summary>
    public partial class Holster_Files : UserControl
    {
        /// <summary>
        /// Count of currently selected files as int.
        /// </summary>
        public int SelectedFilesCount
        { get { return SelectedFiles.Count; } }

        /// <summary>
        /// List of currently selected file-paths (full paths!).
        /// </summary>
        public List<string> SelectedFiles { get; set; }

        /// <summary>
        /// Initialize a new Holster_Files()-Control.
        /// </summary>
        public Holster_Files()
        {
            InitializeComponent();

            SelectedFiles = new List<string>();
        }

        /// <summary>
        /// Edit file-list.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEditFiles_Click(object sender, RoutedEventArgs e)
        {
            Dialoges.Library.FileEditor dlgFileEditor = new Dialoges.Library.FileEditor(this, SelectedFiles);
            dlgFileEditor.ShowDialog();
        }

        /// <summary>
        /// Set file-count-label.
        /// </summary>
        public void setFileCount()
        {
            lblFileCount.Content = SelectedFilesCount.ToString();
        }

        /// <summary>
        /// Set current status image.
        /// </summary>
        public void setStatusIcon()
        {
            if (SelectedFilesCount > 0)
            {
                imgFilesStatus.Source = new BitmapImage(new Uri(@"../../images/bin/save.png", UriKind.Relative));
            }
            else
            {
                imgFilesStatus.Source = new BitmapImage(new Uri(@"../../images/bin/new.png", UriKind.Relative));
            }
        }
    }
}
